home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / batchlrn.arc / GOTO.HLP < prev    next >
Text File  |  1991-06-17  |  3KB  |  40 lines

  1. |---------------B A T C H L R N  H E L P  S Y S T E M-----------------|
  2. |command: GOTO                                                        |
  3. |use: The GOTO command is a batch file-only command. It is used to    |
  4. | perform a "jump" from the GOTO <label> to the :<label>. After the   |
  5. | :<label> (the SECOND one) the program performs the commands listed. |
  6. | In"computereze"this is described as:the GOTO command directing the  |
  7. | program to perform the command following the item described in the  |
  8. | command modifier (so much for that!).                               |
  9. |                                                                  |
  10. |how:Type: GOTO <LABEL> (in a batch file), THEN type:<LABEL> later on |
  11. | for a series of commands to be performed.                           |
  12. |                                      |
  13. |when:GOTO is used in conjunction with (usually) some IF condition    |
  14. | or to create a loop function.                                       |
  15. |                                       |
  16. |examples: In a condition situation you would have SEVERAL GOTOs. For |
  17. | example, IF %1 exists GOTO label 1 (next line) IF %1 not exist GOTO |
  18. | label#2. Elsewhere in the batch file :label#1 AND :label#2 would    |
  19. | both be present, followed by commands you want performed depending  |
  20. | on whether %1 existed or not. USUALLY you create another jump at the|
  21. | end of each :label command set with GOTO END, with the :END label   |
  22. | wrapping up the batch processing no matter what else occured in the |
  23. | previous portions of the file. SEE sample batch files on this disk! |
  24. |more examples:(To create a GOTO loop): 1) :spot                      |
  25. |          this is what you would       2) REM This is a loop         |
  26. |             program (3 lines)         3) GOTO spot                  |
  27. | That would cause an infinite sequence of messages to be displayed:  |
  28. |  A>REM This is a loop                                               |
  29. |  A>GOTO spot                                                        |
  30. |  A>REM This is a loop                                               |
  31. |  A>GOTO spot                                                        |
  32. |  A>REM This is a loop   . . . . etcetera (on & on til you stop it!) |
  33. |NOTES: If you do not include <label> in the GOTO command, the batch  |
  34. | processing file stops. Any line in a batch file that starts with ":"|
  35. | is treated as a label but otherwise ignored. DOS only recognizes the|
  36. | FIRST EIGHT characters in a label. To stop an endless loop GOTO file|
  37. | use CTRL-BREAK or CTRL C.                                           |
  38. |                                                                     |
  39. |----------------- T  I  M  E  M  A  S  T  E  R  ---------------------|
  40.